<html>
<body>
Reports a non-exhaustive <code>when</code> statements that will lead to compilation error since 1.7.
<p>Motivation types:</p>
<ul>
    <li>
        Problematic/meaningless usage patterns need to be discouraged/blocked (e.g. counterintuitive behaviors)
        <ul>
            <li>
                Code is error-prone
            </li>
        </ul>
    </li>
    <li>
        Inconsistency in the design (things are done differently in different contexts)
    </li>
</ul>
<p>Impact types:</p>
<ul>
    <li>
        Compilation. Some code that used to compile won't compile any more
        <ul>
            <li>
                There were cases when such code worked with no exceptions
                <ul>
                    <li>
                        Some such code could compile without any warnings
                    </li>
                </ul>
            </li>
        </ul>
    </li>
</ul>

<p><b>More details:</b> <a href="https://youtrack.jetbrains.com/issue/KT-47709">KT-47709: Make when statements with enum, sealed, and Boolean subjects exhaustive by default</a></p>
<p>The quick-fix adds the missing <code>else -> {}</code> branch.</p>
<p><b>Example:</b></p>
<pre><code>
  sealed class <b>Base</b> {
      class <b>A</b> : <b>Base</b>()
      class <b>B</b> : <b>Base</b>()
  }

  fun test(base: <b>Base</b>) {
      when (base) {
          is <b>Base</b>.<b>A</b> -> ""
      }
  }
</code></pre>
<p>After the quick-fix is applied:</p>
<pre><code>
  sealed class <b>Base</b> {
      class <b>A</b> : <b>Base</b>()
      class <b>B</b> : <b>Base</b>()
  }

  fun test(base: <b>Base</b>) {
      when (base) {
          is <b>Base</b>.<b>A</b> -> ""
          else -> {}
      }
  }
</code></pre>
<!-- tooltip end -->
<p>This inspection only reports if the Kotlin language level of the project or module is 1.6 or higher.</p>
</body>
</html>